﻿using CinemaMaestro.DataLayer.Contracts.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace CinemaMaestro.WebApplication.Models
{
    public class CinemaViewModels
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public string Address { get; set; }
        public string TelephoneNr { get; set; }

        public static implicit operator CinemaViewModels(Cinema cinema)
        {
            return new CinemaViewModels
            {
                Id = cinema.Id,
                Name = cinema.Name,
                Address = cinema.Address,
                TelephoneNr = cinema.TelephoneNr
            };
        }

        public static implicit operator Cinema(CinemaViewModels cinemaVM)
        {
            return new Cinema
            {
                Id = cinemaVM.Id,
                Name = cinemaVM.Name,
                Address = cinemaVM.Address,
                TelephoneNr = cinemaVM.TelephoneNr
            };
        }
    }
}